# 抖码算法，让算法学习变得简单有趣
# 作者：老汤


class TreeNode:
    def __init__(self, val, left, right):
        self.val = val;
        self.left = left
        self.right = right


def pre_order(root):
    if root is None:
        return
    print(root.val)
    pre_order(root.left)
    pre_order(root.right)


def in_order(root):
    if root is None:
        return
    in_order(root.left)
    print(root.val)
    in_order(root.right)


def post_order(root):
    if root is None:
        return
    post_order(root.left)
    post_order(root.right)
    print(root.val)


node5 = TreeNode(7, None, None)
node4 = TreeNode(11, None, None)
node3 = TreeNode(23, None, None)
node2 = TreeNode(9, None, node5)
node1 = TreeNode(8, node3, node4)
root = TreeNode(10, node1, node2)